package org.example.controller;

import jakarta.annotation.Resource;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

@Component
public class TestApplication implements ApplicationRunner {
    @Resource
    private JavaMailSender javaMailSender;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setTo("605823224@qq.com");
        message.setSubject("测试");
        message.setText("ceshi");

        javaMailSender.send(message);
    }

}
